from selenium import webdriver
import time
# -*- coding: utf-8 -*-
# @Time    : 2021/5/27 17:57
__author__ = 'wangd'

mobilesetting={"deviceName":"iPhone 8 Plus"}
options=webdriver.ChromeOptions()  #选项
options.add_experimental_option("mobileEmulation",mobilesetting)  #模拟手机
driver=webdriver.Chrome(chrome_options=options)  #配置参数
driver.set_window_size(400,800)  #设置页面大小
# driver.maximize_window()  #全屏
driver.get("https://you.m.autohome.com.cn/fe/m/index")
time.sleep(5)
# driver.find_element_by_class_name("icon-search").click()
a=driver.find_elements_by_xpath("//input[@type='search']")
print(a)
a[0].click()
time.sleep(1)
b=driver.find_element_by_id("searchInput").send_keys("北京")